<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>

        // var arr = ["张三","李四","王五"];
        // var str = "";
        // arr.forEach(function(item){
        //     str += item+"&";
        // })
        // console.log(str);
        // console.log( str.substr(0,str.length-1));

    //   console.log(   arr.join("&"));


        Object.prototype.height = "178cm";
        var obj = {
            name:"zhangsan",
            age:20
        }


        for(var key in obj){
            // console.log( obj.hasOwnProperty(key)) // 判断 对象的某个属性是否是自身属性，如果是返还true，否则返还false
            // console.log(key);
            if(obj.hasOwnProperty(key)){
                console.log(key);
            }
        }
    </script>
</body>
</html>